<template>
  <div>
    <div id="nav">
      <router-link to="/home"
        ><b-icon icon="chevron-left"></b-icon>返回</router-link
      >
    </div>
    <b-card border-variant="light" header="旅行社列表" align="left">
      <div class="list" v-for="item in list" :key="item.id">
        <h5>
          <b>{{ item.name }}</b>
        </h5>
        <p>地址:{{ item.address }}</p>
        <p>许可编号:{{ item.permit }}</p>
        <p>手机:{{ item.phone }}</p>
        <p>传真:{{ item.fax }}</p>
        <p>邮政编码:{{ item.postal }}</p>
      </div>
    </b-card>
  </div>
</template>

<script>
import bus from "../../eventBus.js";
export default {
  name: "travelAtt",
  data() {
    return {
      list: [],
    };
  },
  props: [],
  created() {
    bus.$on("travelRes", (val) => {
      if (this.list.length != 0) {
        this.list = [];
      }
      this.list = val;
    });
    bus.$on("shareTravel", (val) => {
      if (this.list.length != 0) {
        this.list = [];
      }
      this.list = val;
    });
  },
  methods: {},
};
</script>

<style scoped>
#nav {
  width: 100%;
  padding-left: 5px;
  padding-top: 2px;
}

a {
  text-decoration: none;
  color: white;
  font-size: 20px;
}
a:hover {
  text-decoration: none;
  color: blue;
}
p {
  margin: 0;
  padding: 0;
  font-size: 80%;
}
.list {
  margin: 5px;
  padding: 2px 4px;
  box-shadow: 5px 5px 2px #888888;
}
</style>